package com.demo.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

//@Aspect
//@Component
@Slf4j
public class ControllerLogAop {

	//控制器下所有的类方法
	@Pointcut("execution(* com.demo.controller.*.*(..))")
	public void exeJdbcApi() {
		
	}
	
	@Before("exeJdbcApi()")
	public void beforeExeJdbcApi(JoinPoint joinPoint) {
		String funName = joinPoint.getSignature().getName();
		Object[] args = joinPoint.getArgs();
		log.info("调用 controller :请求方法："+funName);
		for(Object obj:args) {
			log.info("调用 controller :请求参数："+obj);
		}

	}
	
}
